package com.bjtg.threegoclinet.base;

import android.app.Activity;
import android.os.Bundle;

import com.bjtg.threegoclinet.okhttpUtils.OkHttpClientManager;
import com.bjtg.threegoclinet.util.LattePreference;

import java.util.HashMap;
import java.util.Map;

import cn.jpush.android.api.JPushInterface;

/**
 * 公共类
 * 日期:201 7/04/23
 */
public abstract class BaseActivity extends Activity {

    public static BaseActivity context;
    public static final Map<String,String> PARAMMAP = new HashMap<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 清空系统背景图片
//		getWindow().setBackgroundDrawable(null);
        context = this;
        PARAMMAP.put("apiKey", "408c71b7dc404e00a9018035bb7855a1");
        PARAMMAP.put("version", "1.0");
    }

    public OkHttpClientManager OkHttp() {
        return OkHttpClientManager.getInstance();
    }

    public void onStart() {
        super.onStart();
        LattePreference.addOperationId(LattePreference.OPERATION_ID, "1");
        LattePreference.addUserId(LattePreference.USER_ID, "1");
    }

    protected void onResume() {
        super.onResume();
        JPushInterface.onResume(this);
    }

    protected void onPause() {
        super.onPause();
        JPushInterface.onPause(this);
    }

    public void onStop() {
        super.onStop();
    }
}
